package group

import (
	"context"

	"go-admin/base/internal/svc"
	"go-admin/base/internal/types"

	"github.com/zeromicro/go-zero/core/logx"
)

type DeletesLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

func NewDeletesLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeletesLogic {
	return &DeletesLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *DeletesLogic) Deletes(req *types.GroupDeleteReqDTO) (resp *types.GroupBooleanRespDTOS, err error) {
	// todo: add your logic here and delete this line
	err = l.svcCtx.GroupModel.DeleteByIds(l.ctx, req.GroupIds)

	return &types.GroupBooleanRespDTOS{
		Data: true,
		Result: types.Result{
			Code: 200,
		},
	}, nil
}
